/*
 * @Description  :
 * @Autor        : guoxi
 * @Date         : 2022-08-25 14:11:56
 * @LastEditors  :
 * @LastEditTime : 2022-08-25 14:11:56
 * @FilePath     : \snow-pc\src\api\document.ts
 */
import http from "../utils/http/service";

// 获取列表
export const getList = (data): any => {
  return http.post("/snow-admin/sysDocument/documentList", data);
};

// 删除文档
export const onDelete = (data): any => {
  return http.post("/snow-admin/sysDocument/delete", data);
};

// 更新
export const onSave = (data): any => {
  return http.post("/snow-admin/sysDocument/update", data);
};

// 新建文档
export const onAdd = (data): any => {
  return http.post("/snow-admin/sysDocument/add", data);
};

// 文档类型,文件类型
export const postDictList = (data): any => {
  return http.post("/snow-admin/sysDict/dictList", data);
};

// 查询文档详情
export const getDocumentInfo = (data): any => {
  return http.get(`/snow-admin/sysDocument/info/${data.id}`);
};

// 查询文档下载
export const postDownloadList = (data): any => {
  return http.post(`/snow-admin/sysDocument/docDowloadList`, data);
};

// 文档下载
export const postDownload = (data): any => {
  return http.post(`/snow-admin/sysDocument/docZipDowload`, data);
};

export const getTreeDocumentType = (): any => {
  return http.post(`/snow-admin/sysDocument/type/tree`);
};

//B类文档

// 新建文档
export const fileAdd = (data): any => {
  return http.post("/snow-admin/thdDocument/add", data);
};

// 获取文档列表
export const fileList = (data): any => {
  return http.post("/snow-admin/thdDocument/thdDocumentList", data);
};

// 查询文档详情
export const fileInfo = (data): any => {
  return http.get(`/snow-admin/thdDocument/info/${data.id}`);
};

// 更新文档
export const fileUpdate = (data): any => {
  return http.post(`/snow-admin/thdDocument/update`, data);
};

// 删除文档
export const fileDelete = (data): any => {
  return http.post("/snow-admin/thdDocument/delete", data);
};

// 文档下载
export const fileDownload = (data): any => {
  return http.post(`/snow-admin/thdDocument/docZipDowload`, data);
};

// 批量下载文档列表
export const batchDownloadList = (data): any => {
  return http.post(`/snow-admin/thdDocument/thdDocumentList`, data);
};
